]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellButtonBox: only listen to button 1 and single clicks
authorOwen W. Taylor <otaylor@fishsoup.net>
Sat, 29 Aug 2009 17:25:32 +0000 (13:25 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Sat, 29 Aug 2009 19:20:18 +0000 (15:20 -0400)
Only mouse button 1 is supposed to activate button controls; other
mouse buttons should do nothing unless there is a context menu.

Checking the click count is important, since double-clicks will
otherwise look like unpaired button presses.

http://bugzilla.gnome.org/show_bug.cgi?id=593504

src/shell-button-box.c

index 56dd944108525dcc063437110b1adf65aae779a2..a7f54c38ebe1b572719e08b1b2ba6155a682815d 100644 (file)
@@ -117,6 +117,9 @@ shell_button_box_button_press_event (ClutterActor       *actor,
 {
   ShellButtonBox *box = SHELL_BUTTON_BOX (actor);
 
+  if (event->button != 1 || event->click_count != 1)
+    return FALSE;
+
   if (box->priv->held)
     return TRUE;
 
@@ -137,6 +140,9 @@ shell_button_box_button_release_event (ClutterActor       *actor,
 {
   ShellButtonBox *box = SHELL_BUTTON_BOX (actor);
 
+  if (event->button != 1 || event->click_count != 1)
+    return FALSE;
+
   if (!box->priv->held)
     return TRUE;